# -*- mode: python ; coding: utf-8 -*-

block_cipher = None

a = Analysis(
    ['gui_app.py'],
    pathex=[],
    binaries=[],
    datas=[('mystep1v2.py', '.')],
    hiddenimports=[
        'cv2',
        'cv2.cv2',
        'cv2.cv2.cv2',
        'cv2.cv2.cv2.cv2',
        'ultralytics',
        'ultralytics.yolo',
        'ultralytics.yolo.engine',
        'ultralytics.yolo.engine.model',
        'ultralytics.yolo.utils',
        'ultralytics.yolo.utils.ops',
        'ultralytics.yolo.utils.torch_utils',
        'ultralytics.yolo.utils.checks',
        'ultralytics.yolo.utils.files',
        'ultralytics.yolo.utils.plotting',
        'ultralytics.yolo.utils.callbacks',
        'ultralytics.yolo.utils.loss',
        'ultralytics.yolo.utils.metrics',
        'ultralytics.yolo.utils.segment',
        'ultralytics.yolo.utils.tal',
        'ultralytics.yolo.utils.transforms',
        'torch',
        'torchvision',
        'torchvision.transforms',
        'torchvision.transforms.functional',
        'PIL',
        'PIL._tkinter_finder',
        'PIL.Image',
        'PIL.ImageDraw',
        'PIL.ImageFont',
        'tkinter',
        'tkinter.filedialog',
        'tkinter.messagebox',
        'tkinter.ttk',
        'pathlib',
        'threading',
        'subprocess',
        'shutil',
        'time',
        'random',
        'sys',
        'os',
        'mystep1v2',
        'numpy',
        'yaml',
        'requests',
        'tqdm',
        'matplotlib',
        'matplotlib.pyplot',
        'matplotlib.backends.backend_tkagg'
    ],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[
        'matplotlib.tests',
        'numpy.tests',
        'PIL.tests',
        'tkinter.test',
        'unittest',
        'test',
        'tests'
    ],
    win_no_prefer_redirects=False,
    win_private_assemblies=False,
    cipher=block_cipher,
    noarchive=False,
)

# Handle cv2 binary files
import cv2
import os
cv2_path = os.path.dirname(cv2.__file__)
if os.path.exists(cv2_path):
    for file in os.listdir(cv2_path):
        if file.endswith('.dll') or file.endswith('.pyd'):
            a.binaries.append((f'cv2/{file}', os.path.join(cv2_path, file), 'BINARY'))

pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.zipfiles,
    a.datas,
    [],
    name='VideoProcessingApp',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    upx_exclude=[],
    runtime_tmpdir=None,
    console=False,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
    icon=None
) 